package me.znext.learn.android.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

class DBHelper extends SQLiteOpenHelper {

  private static final int VERSION = 1;// 定义数据库版本号
  private static final String DBNAME = "account.db";// 定义数据库名

  DBHelper(Context context) {
    super(context, DBNAME, null, VERSION);
  }

  @Override
  public void onCreate(SQLiteDatabase sqLiteDatabase) {
    sqLiteDatabase.execSQL(
      "CREATE TABLE user (" +
        "uname text primary key," +
        "pw text," +
        "sex text," +
        "birthday text)"
    ); // 创建user表
  }

  @Override
  public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
  }

}
